<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<style type="text/css">
		
		body{
			padding-top:70px;
			padding-left:200px;
			background-color:#cff;
		}
		.bb .aa{
			text-decoration:none;
		}
	</style>	
</head>
<body>

	<%
		
		String state=request.getParameter("state");
		String msg="";
		if("10001".equals(state)){
			msg="用户名或密码错误！";
		}else if("10002".equals(state)){
			msg="注册成功请登录！";
		}
	 %>
	 
	 <div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				</a>
				<form class="navbar-search pull-right">
					<input type="text" class="search-query" placeholder="查找其他详情"/>
				</form>
			<a class="brand" href="index.jsp">欢迎光临</a>
			<div class="nav-collapse">
			<ul class="nav">
				<li class="">
					<a href="yy.jsp">关于</a>
				</li>
			
				<li class="">
				<a href="yy.jsp">帮助？</a>
				</li>
				
			</ul>
			</div>
			</div>
		</div>
	</div><br/><br/>
    	
    	<h1 style="color:blue;font-weight:bold;">项目管理系统</h1><br/><br/>
	 
		
		<form action="login.jspx" class="well" method="post" id="myform" style="margin-left:300px;margin-right:300px;">
			<input type="hidden" name="m" value="login"/>
			<span style="font-size:20px;font-weight:bold">用户名：</span><input type="text" name="username" id="username"/><span id="usernamemsg" style="color:red;"></span><br />
			<span style="font-size:20px;font-weight:bold">密　码：</span><input type="password" name="password" id="password" /><span id="passwordmsg" style="color:red;"></span><br />
			<input type="checkbox" value="check" name="chick"> <span style="font-size:15px;font-weight:bold">记住我</span><br/>
		
			<input type="button" value="登录" class="btn btn-primary"id="login"/>&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" class="btn btn-primary" id="reset"/>
			<br/>
			<p style="color:red;"><%=msg%></p>
		</form>
		
	<script type="text/javascript">
		document.getElementById("login").onclick=function(){
		var username=document.getElementById("username").value;
		var password=document.getElementById("password").value;
			if(username.trim()!=""){
				if(password.trim()!=""){
					document.getElementById("myform").submit();
				}else{
					document.getElementById("password").focus();
					document.getElementById("passwordmsg").innerHTML="密码不能为空！"
				}
			}else{
				document.getElementById("username").focus();
				document.getElementById("usernamemsg").innerHTML="用户名不能为空"
			}
		};
		document.getElementById("username").onblur = function(){
			//alert("onblur");
			if(username.trim()=="") {
				document.getElementById("username").value = "";
				document.getElementById("usernamemsg").innerHTML = "请输入用户名";
				document.getElementById("username").focus();
			}
		};
		document.getElementById("reset").onclick=function(){
			document.getElementById("passwordmsg").innerHTML="";
			document.getElementById("usernamemsg").innerHTML="";
		};
		document.getElementById("username").onkeydown = function(){
			document.getElementById("usernamemsg").innerHTML = "";
		};
		document.getElementById("password").onkeydown = function(){
			document.getElementById("passwordmsg").innerHTML = "";
		};
	</script>

</body>
</html>